package com.wzy.exception;

import com.wzy.enums.AppHttpCodeEnum;
import lombok.Data;

/**
 * 业务异常
 */
@Data
public class SystemException extends RuntimeException
{

    private int code;

    private String msg;

    private String description;

    public SystemException(AppHttpCodeEnum httpCodeEnum)
    {
        super(httpCodeEnum.getMsg());
        this.code = httpCodeEnum.getCode();
        this.msg = httpCodeEnum.getMsg();
    }

    public SystemException(AppHttpCodeEnum httpCodeEnum, String description)
    {
        super(httpCodeEnum.getMsg());
        this.code = httpCodeEnum.getCode();
        this.msg = httpCodeEnum.getMsg();
        this.description = description;
    }

    public int getCode()
    {
        return code;
    }

    public String getMsg()
    {
        return msg;
    }

}